package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.db.SoultestOption;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SoultestOptionMapper extends BaseMapper<SoultestOption> {

    @Select("select a.* from tb_soultest_option a,tb_question_option b where a.id=b.option_id and b.question_id =#{id}")
    List<SoultestOption> getOptions(Long id);
    @Select("<script>" +
            "select\n" + "*\n"+ "from\n" + "tb_soultest_option\n" +
            "where\n" + "id in" +
            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>" +
            "#{id} "+
            "</foreach>" +
            "</script>")
    List<SoultestOption> getScore(@Param("ids")List<Long> ids);
}
